#include<stdio.h>
int pathSum(int n,int l,int nums[]) {
    	int max=0;
        int min=l;
        int mid=l/2;
        int time=0;
        for(int i=0;i<n;i++)
        {
            if(nums[i]<=mid&&nums[i]>max)
            {
                max=nums[i];
            }
            else if(nums[i]>mid&&nums[i]<min)
            {
                min=nums[i];
            }
        }
        min=l-min;
        return max>min ? max : min;
    }
int main()
{
	int s[]={5};
	int num=pathSum(1,10,s);
	printf("%d",num); 
}

